const install = (Vue, vm) => {
	// 公共部分
	let setting = (params) => vm.$u.post('setting', params);
	let upload = (params) => vm.$u.post('upload', params); //上传图片
	// let smsSend = (params) => vm.$u.get('system/user/sendAuthCode/'+params.phone); //发送验证码
    
	// let register = (params) => vm.$u.post('system/user/enrollR', params); //注册
    let login = (params) => vm.$u.post('login', params);//登录
	let homeindex = (params) => vm.$u.post('index', params);//首页接口
	let regionall = (params) => vm.$u.post('region/all', params);//所有地区
	let userinfo = (params) => vm.$u.post('user/info', params);//用户信息
	let register = (params) => vm.$u.post('register', params);//注册
	let sendEmail = (params) => vm.$u.post('sms/send', params);//发送验证码
	let userlog = (params) => vm.$u.post('user/log', params);//用户明细
	let uservip = (params) => vm.$u.post('user/vip', params);//vip
	let userjoinus = (params) => vm.$u.post('user/joinus', params);//合作加盟
	let useredit = (params) => vm.$u.post('user/edit', params);//用户信息编辑
	let usereditpassword = (params) => vm.$u.post('user/edit/password', params);//修改密码
	let userbank = (params) => vm.$u.post('user/bank/get', params);//银行卡回显
	let userbankpost = (params) => vm.$u.post('user/bank/post', params);//银行卡提交
	let orderplace = (params) => vm.$u.post('users/order/place', params);//用户下单
	let orderlists = (params) => vm.$u.post('users/order/lists', params);//用户列表
	let orderinvoice = (params) => vm.$u.post('users/order/invoice', params);//开票
	let withdrawal = (params) => vm.$u.post('withdrawal', params);//提现
	let withdrawalpost = (params) => vm.$u.post('withdrawal/post', params);//提现提交
	let caselist = (params) => vm.$u.post('case/consult', params);//案件列表
	let casepost = (params) => vm.$u.post('case/consult/post', params);//案件提交
	let caseinfo = (params) => vm.$u.post('case/consult/info', params);//案件详情
	let contract = (params) => vm.$u.post('contract', params);//合同首页
	let lawyer = (params) => vm.$u.post('lawyer', params);//律师列表
	let lawyerinfo = (params) => vm.$u.post('lawyer/info', params);//律师详情
	let contractlist = (params) => vm.$u.post('contract/list', params);//合同列表
	let contractinfo = (params) => vm.$u.post('contract/info', params);//合同详情
	let caselists = (params) => vm.$u.post('case/entrust/lists', params);//债务委托
	let zhaicasepost = (params) => vm.$u.post('case/entrust/post', params);//债务提交
	let zhaicaseinfo = (params) => vm.$u.post('case/entrust/info', params);//债务详情
	let clerkclass = (params) => vm.$u.post('clerk/class', params);//文书分类
	let clerkpost = (params) => vm.$u.post('clerk/post', params);//文书提交
	let clerklist = (params) => vm.$u.post('clerk/lists', params);//文书列表
	let clerkinfo = (params) => vm.$u.post('clerk/info', params);//文书详情
	let lawhallindex = (params) => vm.$u.post('lawhall/index', params);//法律讲堂
	let lawhallinfo = (params) => vm.$u.post('lawhall/info', params);//法律讲堂心详情
	let tibank = (params) => vm.$u.post('test/bank', params);//所有题库
	let tipaper = (params) => vm.$u.post('test/paper', params);//获取题库下面试卷
	let tistart = (params) => vm.$u.post('test/start', params);//开始练习
	let titopic = (params) => vm.$u.post('test/topic', params);//考试试卷答题详情
	let ticollect = (params) => vm.$u.post('test/collect', params);//考试收藏
	let topiclist = (params) => vm.$u.post('test/topic/list', params);//题目搜索
	
	let toentry = (params) => vm.$u.post('test/entry', params);//考试报名
	let toentrylist = (params) => vm.$u.post('test/entry/list', params);//报名列表
	let toendownload = (params) => vm.$u.post('users/order/download', params);//合同下载
	let kaexchange = (params) => vm.$u.post('carmi/exchange', params);//卡密兑换
	let lihistory = (params) => vm.$u.post('test/history', params);//历史成绩
	let kaostart = (params) => vm.$u.post('test/entry/start', params);//开始考试
	let kaosubmitto = (params) => vm.$u.post('test/submitto', params);//提交答案 
	let kaocollectinfo = (params) => vm.$u.post('test/collect/info', params);//收藏接口
	let news = (params) => vm.$u.post('news', params);//新闻列表
	let newsinfo = (params) => vm.$u.post('news/info', params);//新闻详情
	let lunindex = (params) => vm.$u.post('test/index', params);//轮播图
	let loginlindx = (params) => vm.$u.post('login/code', params);//验证码登录
	let textwrong = (params) => vm.$u.post('test/wrong', params);//错题列表
	let cuotidel = (params) => vm.$u.post('test/wrong/delete', params);//错题删除
	let cuotiqing = (params) => vm.$u.post('test/wrong/empty', params);//错题清空
	let joinus = (params) => vm.$u.post('user/joinus/get', params);//战旅合作
	let artificial = (params) => vm.$u.post('artificial/get', params);//人工咨询
	let artificialpost = (params) => vm.$u.post('artificial/post', params);//人工咨询提交
	let adviser = (params) => vm.$u.post('user/adviser', params);//成为顾问
	let topicsee = (params) => vm.$u.post('test/topic/see', params);//查看题目
	let topphb = (params) => vm.$u.post('test/phb', params);//排行榜
	
	// ai 法务
	const get_once = (params) => vm.$u.post('/chat/index', params);
	const chatIndex = (params) => vm.$u.post('/chat/index', params);
	const chatSend = (params) => vm.$u.post('/chat/send', params);
	const chatGroup = (params) => vm.$u.post('/chat/group', params)
	const chatGroupNew = (params) => vm.$u.post('/chat/group/new', params)
	const chatGroupEdit = (params) => vm.$u.post('/chat/group/edit', params)
	const chatGroupDel = (params) => vm.$u.post('/chat/group/del', params)
	const chatGroupEmpty = (params) => vm.$u.post('/chat/group/empty', params)
	// 
	vm.$u.api = {
		login,
		homeindex,
		regionall,
		userinfo,
		register,
		sendEmail,
		userlog,
		uservip,
		userjoinus,
		useredit,
		usereditpassword,
		userbank,
		userbankpost,
		orderplace,
		orderlists,
		orderinvoice,
		withdrawal,
		withdrawalpost,
		caselist,
		casepost,
		caseinfo,
		contract,
		lawyer,
		lawyerinfo,
		contractlist,
		contractinfo,
		caselists,
		zhaicasepost,
		zhaicaseinfo,
		clerkpost,
		clerkclass,
		clerklist,
		clerkinfo,
		lawhallindex,
		lawhallinfo,
		setting,
		tibank,
		tipaper,
		tistart,
		titopic,
		ticollect,
		topiclist,
		toentry,
		toentrylist,
		toendownload,
		kaexchange,
		lihistory,
		kaostart,
		kaosubmitto,
		kaocollectinfo,
		news,
		newsinfo,
		lunindex,
		loginlindx,
		textwrong,
		cuotidel,
		cuotiqing,
		get_once,
		chatIndex,
		chatSend,
		chatGroup,
		chatGroupNew,
		chatGroupEdit,
		chatGroupDel,
		chatGroupEmpty,
		joinus,
		artificial,
		artificialpost,
		adviser,
		topicsee,
		topphb
	};
}
export default {
	install
}
// async getuserinfo(){
	// let res = await this.$u.api.userinfo({
	// 	a:a
	// });
// }
// if(res.code == 200){
// 	this.$u.toast("提货成功");
// 	this.goodList = []
// 	this.getlist();
// }else{
// 	this.$u.toast("失败");
// }
//:src="ossThree(item.bigimage)"

// getClear(){
// 	this.list = []
// 	this.page = 1,
// 	this.status= "loadmore"
// 	this.getList()
// }
// userid:uni.getStorageSync('userid')
// :src="ossThree('/ui/twobg.png')"
// list: [],
// page: 1,
// limit: 10,
// last_page: 1,
// status: "loadmore",

{/* <u-loadmore :status="status" @loadmore="loadmore" /> */}

// async getList(){//列表数据
// 	let res = await this.$u.api.userlog({
// 		limit:this.limit,
// 		  page:this.page,
// 		field:'balance'
// 	});
// 	// console.log(res)
// 	this.uinfo = res
// 	this.last_page = res.list.last_page;
// 	let list = res.list.list;
// 	this.list = this.page == 1 ? list : [...this.list, ...list];	
// 	if(this.page >= this.last_page){
// 	  this.status = 'nomore';
// 	}
	
// },
// loadmore() {
// 	let page = this.page;
// 	if (this.status == 'loadmore') {
// 		this.page++;
// 		this.getList();
// 	}
// },

// onReachBottom: function () {
// 	this.loadmore();
// },